package jp.co.realsys.dao.impl;


import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import jp.co.realsys.dao.UserDBDao;
import jp.co.realsys.error.TaskException;
import jp.co.realsys.model.UserModel;
@Repository
public class UsersDBDaoImpl extends SqlSessionDaoSupport implements UserDBDao {
	
	@Resource
	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		super.setSqlSessionFactory(sqlSessionFactory);
	}

	@Override
	public boolean doCheckUser(UserModel model) throws TaskException {
		Integer result = getSqlSession().selectOne("jp.co.realsys.dao.impl.userMapper.countUser",model);
		if (result != null &&result > 0){
			return true;
		}
		return false;
	}
	
}
